length-insert length-value ornament-lengths &optional how seed
This function facilitates the insertion of complex rhythmic ornaments. An ornamental 'gesture' usually made from a list of tick values can be inserted into the space of a length- value. What is left of the length-value into which the ornament-lengths have been inserted is added to the ornament- lengths as a note-length rest. The default position of this rest is at the start of the ornament-lengths thereby creating an anticipatory ornament commonly used to intensify the rhythm of a phrase.
(length-insert '1/1 '(45 13 14 16 19 25 32))
--> (-1756 45 13 14 16 19 25 32)
By using the &optional 'end keyword this rest may be placed at the end of ornament- lengths thereby creating an acciaccaturra or appoggiatura.
(length-insert '768 '(45 13 14 16 19 25 32) 'end)
--> (45 13 14 16 19 25 32 -604)
With the 'rand keyword the two rests-lengths are placed either side of the ornament- lengths. Their respective values are randomize with an &optional seed) but their total, with the sum of the ornament-lengths, is equal to the length-value. This produces an ornament whose execution has an improvisatory potential.
Ratios or ticks may be used for length-value and ornament-lengths.
(length-insert '5/4 '(1/32 1/32 1/16 1/8 1/16))
--> (-1800 60 60 120 240 120)
Here is a short example of length-insert in action. Note how the symbol-patterns matching the ornament-lengths include an appropriately placed symbol rest. Note also the use of both flatten and apply 'append. The latter does not conflict with transposed symbol parentheses.